<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />                                        
<title>.::教务在线V1.0 | 我的教务在线::.</title> 
<link
	href="${pageContext.request.contextPath}/bootstrap/2.1.1/css/bootstrap.min.css"
	type="text/css" rel="stylesheet" />
<link href="${pageContext.request.contextPath}/css/default.css"
	type="text/css" rel="stylesheet" />
<script type="text/javascript" src="${pageContext.request.contextPath}/js/jquery-1.8.2.js"></script>	
<script type="text/javascript" >  
Ext.onReady(function(){ 
    Ext.QuickTips.init();
 /*    Ext.BLANK_IMAGE_URL='images/default/s.gif';    */
            //学生个人数据  本地json
    var treeOfMyData=new Ext.tree.TreePanel({
        title:'我的数据',
        iconCls: 'user',
        useArrows: true,
        autoScroll: true,
        animate: true,
        containerScroll: true,
        border: false,   
        loader:new Ext.tree.TreeLoader(),
        root: new Ext.tree.AsyncTreeNode({
            text: '2012学年上学期',
            expanded: true,
            children:[
               {text:'我的课表',leaf:true,url:"login.jsp"},                  
               {text:'学籍信息',leaf:true,url:"StuXgInfo.php"},
               {text:'授课计划',leaf:true,url:"stuSkjh.php"},
               {text:'网上报名',leaf:true,url:"stuBm.php"},
               {text:'学评教',leaf:true,url:"stuXpj.php"},
               {text:'成绩查询',children:[
                     {text:'最近期末成绩',leaf:true,url:"stuQmCj.php"}, 
                     {text:'成绩总表',leaf:true,url:"StuAllCj.php"}
               ]},
               {text:'考试安排',children:[
                     {text:'期末考试',leaf:true,url:"stuKsap.php"},
                     {text:'补考考试',leaf:true,url:"stuBkKsap.php"}
               ]}			   
        ]             
        }) 

        //rootVisible:false
    });

    //定义事件
    treeOfMyData.on("click",function(node){
         if(node.leaf){
             //alert(node.attributes['url']); 
            if (Ext.getCmp("mainPanel").getItem("searchPanel")){
                var tmpPanel=Ext.getCmp("mainPanel").getItem("searchPanel");
                Ext.getCmp("mainPanel").setActiveTab("searchPanel"); 
                tmpPanel.setTitle("我的数据-->"+node.text);
                tmpPanel.load({
                          url:'controler/'+node.attributes['url'],
                          params:{stuId:'me'},
                          method:'GET',
                          scripts:true   
                }) 
            }
            else {
                   var actionPanel=new Ext.Panel({
                        id:'searchPanel',
                        title: "我的数据-->"+node.text,
                        bodyStyle:'background-color:#fff',
                        iconCls: 'imgHelp',  
                        autoScroll: true,
                        closable:true,
                        autoLoad:{
                          url:'controler/'+node.attributes['url'],
                          method:'GET',
                          params:{stuId:'me'},
                          scripts:true   
                       } 
                   });
 
                   Ext.getCmp("mainPanel").add(actionPanel);
                   Ext.getCmp("mainPanel").setActiveTab(actionPanel);                
                }   
         }                 
    })

    //登录服务
    var treeOfDl=new Ext.tree.TreePanel({
        title:'登录服务',
        iconCls: 'user',
        useArrows: true,
        autoScroll: true,
        animate: true,
        containerScroll: true,
        border: false,   
        loader:new Ext.tree.TreeLoader()
        //rootVisible:false
    });
    var rootOfDl =new Ext.tree.AsyncTreeNode({
        expanded: true,   
        text: '请选择', 
         children:[
           {text:'密码修改',leaf:true,url:"setNewPsw.php"}, 
           {text:'重新登录',leaf:true,url:"reLogin.php"}            
        ]             
    })
    treeOfDl.setRootNode(rootOfDl); 
    treeOfDl.on("click",function(node){
         if(node.leaf){
             //alert(node.attributes['url']); 
            if (Ext.getCmp("mainPanel").getItem("LoginService")){
                var tmpPanel=Ext.getCmp("mainPanel").getItem("LoginService");
                Ext.getCmp("mainPanel").setActiveTab("LoginService"); 
                tmpPanel.setTitle("登录服务-->"+node.text);
                tmpPanel.load({
                          url:'controler/'+node.attributes['url'],
                          params:{stuId:'me'},
                          scripts:true   
                }) 
            }
            else {
                   var actionPanel=new Ext.Panel({
                        id:'LoginService',
                        title: "登录服务-->"+node.text,
                        bodyStyle:'background-color:#fff',
                        iconCls: 'user',  
                        autoScroll: true,
                        closable:true,
                        autoLoad:{
                          url:'controler/'+node.attributes['url'],
                          params:{stuId:'me'},
                          scripts:true   
                       } 
                   });     
                   Ext.getCmp("mainPanel").add(actionPanel);
                   Ext.getCmp("mainPanel").setActiveTab(actionPanel);                
                }   
         }                 
    })       
    //公共服务
    var treeOfPublic=new Ext.tree.TreePanel({
        title:'公共查询服务',
        iconCls: 'edit',
        useArrows: true,
        autoScroll: true,
        animate: true,
        containerScroll: true,
        border: false,   
        loader:new Ext.tree.TreeLoader()
        //rootVisible:false
    });
    var rootOftreeOfPublic =new Ext.tree.AsyncTreeNode({
        expanded: true,   
        text: '请选择', 
         children:[
           {text:'教学进程',leaf:true,url:"pubJxjc.php"}, 
           {text:'校历查询',leaf:true,url:"../filelist.php?searchKey=0001"},     
           {text:'班级学生名单',leaf:true,url:"pubStuMd.php"},
           {text:'历史数据',children:[
                     {text:'课表',leaf:true,url:"../filelist.php?searchKey=0001"}
                     ]
           }
            
        ]             
    })
    treeOfPublic.setRootNode(rootOftreeOfPublic); 
    treeOfPublic.on("click",function(node){
         if(node.leaf){
             //alert(node.attributes['url']); 
            if (Ext.getCmp("mainPanel").getItem("publicService")){
                var tmpPanel=Ext.getCmp("mainPanel").getItem("publicService");
                Ext.getCmp("mainPanel").setActiveTab("publicService"); 
                tmpPanel.setTitle("公共服务-->"+node.text);
                tmpPanel.load({
                          url:'controler/'+node.attributes['url'],
                          scripts:true   
                }) 
            }
            else {
                   var actionPanel=new Ext.Panel({
                        id:'publicService',
                        title: "公共服务-->"+node.text,
                        bodyStyle:'background-color:#fff',
                        iconCls: 'edit',  
                        autoScroll: true,
                        autoWidth :true,
                        closable:true, 
                        autoLoad:{
                          url:'controler/'+node.attributes['url'],
                          scripts:true   
                       } 
                   });     
                   Ext.getCmp("mainPanel").add(actionPanel);
                   Ext.getCmp("mainPanel").setActiveTab(actionPanel);                
                }   
         }                 
    }) 

    //主操作区面板定义
    var mainPanel=new Ext.TabPanel({
                id:'mainPanel',
                region: 'center', // a center region is ALWAYS required for border layout
                margins:'3 0 3 0',
                deferredRender: true,
                enableTabScroll:true,
                activeTab: 0,     // first tab initially active
                items: [{
                    id:'helpPanel',
                    //autoLoad:{url:'loginform.htm',scripts:true},
                    title: '操作说明',
                    iconCls:'imgHelp', 
                    autoScroll: true
                }
                ]
    })

    
    //主界面定义
    var viewpot=new Ext.Viewport({
       layout:'border',
       items:[{
           region:'north',
           border:false,
           height:80,
           contentEl:'head',                                                    
           bodyStyle:"background:   url(images/stageBk.jpg) #eaeaea no-repeat 0 0;" 
       },
       {
           region:'south',
           height:23,
           border: false,
           contentEl:'footer',
           bodyStyle:"background:#eaeaea ;"                                                         
        },
       {
           region:'west',
           contentEl:'west',
           width:200,
           //split:true,
           //title:'<span>west</span>',
           margins:'3 3 3 3',
           collapsible:true,
           layout:'accordion',
           deferredRender: true,           
           defaults: {
                bodyStyle: 'padding:1px',
                border: false
            },    
           layoutConfig:{
               titleCollapse:true,
               //animate:true,
               activeOnTop:false  
           },
           items:[treeOfMyData,treeOfPublic,treeOfDl]
           
       },
        mainPanel
       ]
   });    
 
   
                 


})
</script>
</head>
<body >  
	<div id="container">
    <div id="header" >
         <div id='header-right' >                  
         <a href="login.jsp">注销登陆</a> | <a href="#">意见建议</a><br /><br />
         唐乾岚同学,您好！今天是2012年12月17日   
         </div>
    </div>
    <div id="mainContent">
    <div id="sidebar"style='text-align: left;'></div>
   <div id="content" style='text-align: right;'></div>
    </div>
    <div id="footer" style="text-align:center;margin: 3px;" >Designed by  L.H D.J&copy</div>   
    </div>
</body>
</html>